.TH std::basic_regex 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::basic_regex \- std::basic_regex

.SH Synopsis
   Defined in header <regex>
   template<

       class CharT,                             \fI(since C++11)\fP
       class Traits = std::regex_traits<CharT>

   > class basic_regex;

   The class template basic_regex provides a general framework for holding regular
   expressions.

   Several typedefs for common character types are provided:

   Defined in header <regex>
   Type        Definition
   std::regex  std::basic_regex<char>
   std::wregex std::basic_regex<wchar_t>

.SH Member types

   Member type Definition
   value_type  CharT
   traits_type Traits
   string_type Traits::string_type
   locale_type Traits::locale_type
   flag_type   std::regex_constants::syntax_option_type

.SH Member functions

   constructor   constructs the regex object
                 \fI(public member function)\fP
   destructor    destructs the regex object
                 \fI(public member function)\fP
   operator=     assigns the contents
                 \fI(public member function)\fP
   assign        assigns the contents
                 \fI(public member function)\fP
.SH Observers
                 returns the number of marked sub-expressions within the regular
   mark_count    expression
                 \fI(public member function)\fP
   flags         returns the syntax flags
                 \fI(public member function)\fP
.SH Locale
   getloc        get locale information
                 \fI(public member function)\fP
   imbue         set locale information
                 \fI(public member function)\fP
.SH Modifiers
   swap          swaps the contents
                 \fI(public member function)\fP
.SH Constants

   Grammar option    Effect(s)
   ECMAScript        Use the Modified ECMAScript regular expression grammar.
   basic             Use the basic POSIX regular expression grammar (grammar
                     documentation).
   extended          Use the extended POSIX regular expression grammar (grammar
                     documentation).
   awk               Use the regular expression grammar used by the awk utility in
                     POSIX (grammar documentation).
                     Use the regular expression grammar used by the grep utility in
   grep              POSIX. This is effectively the same as the basic option with the
                     addition of newline '\\n' as an alternation separator.
                     Use the regular expression grammar used by the grep utility, with
   egrep             the -E option, in POSIX. This is effectively the same as the
                     extended option with the addition of newline '\\n' as an
                     alternation separator in addition to '|'.
   Grammar variation Effect(s)
   icase             Character matching should be performed without regard to case.
                     When performing matches, all marked sub-expressions (expr) are
   nosubs            treated as non-marking sub-expressions (?:expr). No matches are
                     stored in the supplied std::regex_match structure and mark_count()
                     is zero.
                     Instructs the regular expression engine to make matching faster,
   optimize          with the potential cost of making construction slower. For
                     example, this might mean converting a non-deterministic FSA to a
                     deterministic FSA.
   collate           Character ranges of the form "[a-b]" will be locale sensitive.
   multiline \fI(C++17)\fP Specifies that ^ shall match the beginning of a line and $ shall
                     match the end of a line, if the ECMAScript engine is selected.

   At most one grammar option can be chosen out of ECMAScript, basic, extended, awk,
   grep, egrep. If no grammar is chosen, ECMAScript is assumed to be selected. The
   other options serve as variations, such that std::regex("meow", std::regex::icase)
   is equivalent to std::regex("meow", std::regex::ECMAScript|std::regex::icase).

   The member constants in basic_regex are duplicates of the syntax_option_type
   constants defined in the namespace std::regex_constants.

.SH Non-member functions

   std::swap(std::basic_regex) specializes the std::swap algorithm
   \fI(C++11)\fP                     \fI(function template)\fP

   Deduction guides\fI(since C++17)\fP
